Skip to content

[Backend Tester] Seed based on test name #13313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: gh/GregoryComer/123/head
Choose a base branch
from

Conversation

GregoryComer
Copy link
Member

@GregoryComer GregoryComer commented Aug 12, 2025

Set a manual seed for pytorch based on the test base name (test case not including flow / etc.). This makes test results stable between runs and between backends/flows. This is useful for comparing accuracy between backends, for example.

I validated this change by running convolution tests for xnnpack twice. I validated that the output accuracy statistics were identical.

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Aug 12, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/13313

Note: Links to docs will display an error until the docs builds have been completed.

❌ 6 New Failures, 3 Unrelated Failures

As of commit e7b7975 with merge base d7ecd87 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 12, 2025
ghstack-source-id: fc23afa
ghstack-comment-id: 3177836622
Pull-Request: #13313
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 12, 2025
ghstack-source-id: 6f79864
ghstack-comment-id: 3177836622
Pull-Request: #13313
@@ -40,6 +41,16 @@
}


def _get_test_seed(test_base_name: str) -> int:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not set a new, global seed every run? And print it somewhere to reproduce. Hardcoding seed ==> we will test with same random numbers every time, not sure if that's what we want.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update to generate a random run-wide seed and allow specifying a seed from CLI.

[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 12, 2025
ghstack-source-id: 0a4ac57
ghstack-comment-id: 3177836622
Pull-Request: #13313
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 12, 2025
ghstack-source-id: a1a6fba
ghstack-comment-id: 3177836622
Pull-Request: #13313
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 12, 2025
ghstack-source-id: a1a6fba
ghstack-comment-id: 3177836622
Pull-Request: #13313
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 12, 2025
ghstack-source-id: abd8e0d
ghstack-comment-id: 3177836622
Pull-Request: #13313
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 12, 2025
ghstack-source-id: abd8e0d
ghstack-comment-id: 3177836622
Pull-Request: #13313
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 12, 2025
ghstack-source-id: f3c1119
ghstack-comment-id: 3177836622
Pull-Request: #13313
[ghstack-poisoned]
GregoryComer added a commit that referenced this pull request Aug 13, 2025
ghstack-source-id: f123042
ghstack-comment-id: 3177836622
Pull-Request: #13313
GregoryComer added a commit that referenced this pull request Aug 13, 2025
ghstack-source-id: f123042
ghstack-comment-id: 3177836622
Pull-Request: #13313
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants